﻿using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

[RequireComponent(typeof(TextMeshProUGUI))]
public class UpdateMoney : MonoBehaviour
{
    private static UpdateMoney Instance;
    private TextMeshProUGUI money;

    void Start()
    {
        Instance = this;
        money = GetComponent<TextMeshProUGUI>();
        StartUpdateMoney();
    }

    void OnEnable()
    {
        StartUpdateMoney();
    }

    void Update()
    {

    }

    public static void StartUpdateMoney()
    {
        if (Instance == null) return;
        Instance.money.text = "<sprite=0> X" + PlayerPrefs.GetInt("playerGem");
    }
}
